package com.luhuiguo.gwt.mvp.dispatcher.shared.rpc;

/**
 * A common use-case is returning a single value from an action. This provides a
 * simple, type-safe superclass for such results.
 * 
 * <p>
 * <b>Note:</b> Subclasses should provide both an empty constructor for
 * serialization and a constructor with a single value for normal use. It is
 * recommended that the empty constructor is private or package-private.
 * 
 * @author LuHuiguo
 * @version $Id: GenericResult.java 11 2009-12-26 13:39:17Z luhuiguo $
 * 
 * @param <T>
 *            The value type.
 */
public abstract class GenericResult<T> implements Result {

    private static final long serialVersionUID = 7599350577683118773L;

    private T value;

    protected GenericResult() {
    }

    public GenericResult(T value) {
        this.value = value;
    }

    public T get() {
        return value;
    }

}
